package cn.org.haitang.resource.support;

import java.io.Serializable;

public class ResultJson implements Serializable {

	private static final long serialVersionUID = 1L;

	public Boolean success;

	public static ResultJson success() {
		ResultJson result = new ResultJson();
		result.setSuccess(true);
		return result;
	}

	public static ResultJson failure() {
		ResultJson result = new ResultJson();
		result.setSuccess(false);
		return result;
	}

	public static ResultJson success(Object data) {
		ResultJsonWithData result = new ResultJsonWithData(data);
		result.setSuccess(true);
		return result;
	}

	public static ResultJson success(String message) {
		ResultJsonWithData result = new ResultJsonWithData(message);
		result.setSuccess(true);
		return result;
	}

	public static ResultJson failure(Object data) {
		ResultJsonWithData result = new ResultJsonWithData(data);
		result.setSuccess(false);
		return result;
	}

	public static ResultJson failure(String message){
		ResultJsonWithData result = new ResultJsonWithData(message);
		result.setSuccess(false);
		return result;
	}

	public Boolean getSuccess() {
		return success;
	}

	public void setSuccess(Boolean success) {
		this.success = success;
	}

}
